package com.opengate.demo.contact.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author 曳戈泰尔
 * @version 1.0
 * @description DemoResultEnum
 * @date 2023/4/27 5:46 PM
 */
@Getter
@AllArgsConstructor
public enum DemoResultEnum {
    DEMO_201(201, "账户密码信息有误");

    private final int value;
    private final String text;

    /**
     * 根据value获取枚举
     *
     * @param value value
     * @return 枚举
     */
    public static DemoResultEnum getEnum(int value) {
        for (final DemoResultEnum item : DemoResultEnum.values()) {
            if (item.value == value) {
                return item;
            }
        }
        return null;
    }
}
